package com.xc.smart.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import org.springframework.security.core.GrantedAuthority;

import java.io.Serializable;

/**
 * 
 *   @author mtl
 *   2021/6/15
 */
@Data
@TableName(value = "um_t_role")
public class Role implements Serializable, GrantedAuthority {
    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;

    @TableField(value = "description")
    private String description;

    @TableField(value = "created_time")
    private Long createdTime;

    @TableField(value = "`name`")
    private String name;

    @TableField(value = "`role`")
    private String role;

    private static final long serialVersionUID = 1L;

    public static final String COL_ID = "id";

    public static final String COL_DESCRIPTION = "description";

    public static final String COL_CREATED_TIME = "created_time";

    public static final String COL_NAME = "name";

    public static final String COL_ROLE = "role";

    
    @Override
    public String getAuthority() {
        return this.role;
    }
}